test-pull-untrusted.sh: always corrupt a regular file, not a symlink
authorJonathan Lebon <jlebon@redhat.com>
Thu, 31 Mar 2016 13:07:01 +0000 (14:07 +0100)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Thu, 31 Mar 2016 14:22:06 +0000 (14:22 +0000)
commit7835fcdc682ef02654ae6aee98b45283478ec275
tree7e85b4e720c7d2c7f769d1df973cf9703b874d27
parente1ce859368b41c863fe096df84f1ff33e90d725f
test-pull-untrusted.sh: always corrupt a regular file, not a symlink

test-pull-untrusted.sh would pass when run as root, but fail when run
as testuser. It turned out that the way the files were stored in the
repo when running as a testuser were different, which meant that a
different .file object was chosen for corruption. Except that file
turned out to be a symlink, so the echo "broke" actually just wrote
to the no_such_file symlink target, thus keeping the actual symlink
file's checksum the same and causing the pull-local to pass when it
should have failed.

[smcv: split this out of a larger commit, part of PR #231]
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
tests/test-pull-untrusted.sh